repo-pull: add option to set the async update frequency
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 8 Mar 2017 17:14:15 +0000 (14:14 -0300)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 8 Mar 2017 20:28:27 +0000 (20:28 +0000)
commitd8ac9f75cdb567cade86c51c4f7b65151fc4273f
tree48277410b85f33b27f359e413849abaf9d837445
parent031d7898ccb4ab4aa5fe994b016cb785dad2b895
repo-pull: add option to set the async update frequency

When using Flatpak with GNOME Software, it is important to
show the progress of the download and install as close as
possible to the real progress.

However, OSTree forces the frequency to call the async
progress callback to 1 second, which causes an unpleasant
effect on the UI, specially when the download size is so
small that everything happens in less than 1 second.

Fix that by adding making OSTree read a custom 'update-frequency'
option and set the timeout source timeout to that. If
no custom frequency is passed, we assume the default 1
second timeout, maintaining the current behavior.

Closes: #725
Approved by: jlebon
src/libostree/ostree-repo-pull.c